.TH std::ranges::bidirectional_range 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::ranges::bidirectional_range \- std::ranges::bidirectional_range

.SH Synopsis
   Defined in header <ranges>
   template< class T >

     concept bidirectional_range =                                        \fI(since C++20)\fP

       ranges::forward_range<T> &&
   std::bidirectional_iterator<ranges::iterator_t<T>>;

   The bidirectional_range concept is a refinement of range for which ranges::begin
   returns a model of bidirectional_iterator.

.SH Example


// Run this code

 #include <forward_list>
 #include <list>
 #include <ranges>
 #include <set>
 #include <unordered_set>

 int main()
 {
     static_assert(
             std::ranges::bidirectional_range<std::set<int>> and
         not std::ranges::bidirectional_range<std::unordered_set<int>> and
             std::ranges::bidirectional_range<std::list<int>> and
         not std::ranges::bidirectional_range<std::forward_list<int>>
     );
 }

.SH See also

   ranges::forward_range       specifies a range whose iterator type satisfies
   (C++20)                     forward_iterator
                               (concept)
   ranges::random_access_range specifies a range whose iterator type satisfies
   (C++20)                     random_access_iterator
                               (concept)
